/** 水浒传 比倍 */
class SHZGameView2 extends eui.Component {
    /** 压的分数 */
    public yscore:eui.Label;
    /** 主动画 */
    private leaderMv:egret.MovieClip;
    /** 左边动画 */
    private leftMv:egret.MovieClip;
    /** 右边动画 */
    private rightMv:egret.MovieClip;

    public constructor() {
		super();
        this.percentHeight = this.percentWidth = 100;
        this.skinName = "SHZGameSkin2";
	}

    /** 子组件创建完成 */
    protected childrenCreated(): void {
        let mcFactory:egret.MovieClipDataFactory = new egret.MovieClipDataFactory(RES.getRes("dealer_common_json"), RES.getRes("dealer_common_png"));
		this.leaderMv = new egret.MovieClip(mcFactory.generateMovieClipData("dealer_common"));
        this.leaderMv.frameRate = 10;
		this.addChild(this.leaderMv);
		this.leaderMv.play(-1);

        mcFactory = new egret.MovieClipDataFactory(RES.getRes("left_common_json"), RES.getRes("left_common_png"));
		this.leftMv = new egret.MovieClip(mcFactory.generateMovieClipData("left_common"));
        this.leftMv.frameRate = 5;
		this.addChild(this.leftMv);
		this.leftMv.play(-1);

        mcFactory = new egret.MovieClipDataFactory(RES.getRes("right_common_json"), RES.getRes("right_common_png"));
		this.rightMv = new egret.MovieClip(mcFactory.generateMovieClipData("right_common"));
        this.rightMv.frameRate = 5;
		this.addChild(this.rightMv);
		this.rightMv.play(-1);
    }

    public updateDisplayList(unscaledWidth, unscaledHeight):void{
		super.updateDisplayList(unscaledWidth, unscaledHeight);

        this.rightMv.scaleX = this.leftMv.scaleX = this.leaderMv.scaleX = unscaledWidth / 1280;
        this.rightMv.scaleX = this.leftMv.scaleX = this.leaderMv.scaleY = unscaledHeight / 720;
        this.leaderMv.x = unscaledWidth * .26;
        this.leaderMv.y = unscaledHeight * .04;
        this.leftMv.x = -unscaledWidth * .05;
        this.leftMv.y = unscaledHeight * .25;
        this.rightMv.x = unscaledWidth * .69;
        this.rightMv.y = unscaledHeight * .25;
    }
}